<template>
	<view id="view" class="flex-column-center-around">
		<view class="box">
			<u-icon size="100" name="lock-open" label="通行码" labelPos="bottom" @click="goTo('/pages/access/access')"></u-icon>
		</view>
		<view class="box">
			<u-icon size="100" name="edit-pen" label="申请出行" labelPos="bottom" @click="goTo('/pages/apply/apply')"></u-icon>
		</view>
		<view class="box">
			<u-icon size="100" name="scan" label="扫一扫" labelPos="bottom" @click="scan"></u-icon>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		onLoad() {

		},
		methods: {
			scan(){
				uni.scanCode({
					onlyFromCamera: true,
					success: function (res) {
						console.log('条码类型：' + res.scanType);
						console.log('条码内容：' + res.result);
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	#view{
		height: 100vh;
		.box{
			width: 300rpx;
			height: 300rpx;
			background-color: #ddd;
			text-align: center;
			box-shadow: 0 0 10px 0px rgba($color: #ddd, $alpha: 1.0);
			&:hover{
				background-color: #ccc;
			}
		}
	}
</style>

